<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试导出功能</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            padding: 20px;
            background: #f5f5f5;
        }
        .test-container {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            max-width: 600px;
            margin: 0 auto;
        }
        .export-btn {
            padding: 8px 16px;
            background: #6366f1;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            min-width: 120px;
            justify-content: center;
            margin: 10px 0;
        }
        .export-btn:hover:not(:disabled) {
            background: #4f46e5;
        }
        .export-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        .export-btn.loading {
            background: #6b7280;
        }
        .export-spinner {
            width: 14px;
            height: 14px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top: 2px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="test-container">
        <h2>导出功能测试</h2>
        <p>这个页面用于测试导出功能的样式和交互</p>
        
        <h3>正常状态</h3>
        <button class="export-btn">
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                <polyline points="7,10 12,15 17,10"></polyline>
                <line x1="12" y1="15" x2="12" y2="3"></line>
            </svg>
            <span>导出Excel</span>
        </button>
        
        <h3>加载状态</h3>
        <button class="export-btn loading" disabled>
            <div class="export-spinner"></div>
            <span>导出中...</span>
        </button>
        
        <h3>禁用状态</h3>
        <button class="export-btn" disabled>
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                <polyline points="7,10 12,15 17,10"></polyline>
                <line x1="12" y1="15" x2="12" y2="3"></line>
            </svg>
            <span>导出Excel</span>
        </button>
        
        <h3>功能说明</h3>
        <ul>
            <li>点击导出按钮会调用后端API导出当前类型的数据</li>
            <li>导出过程中按钮会显示加载状态，防止重复点击</li>
            <li>支持的类型：PR通稿(PR)、综合外链(AUTO)、高价值外链(MANUAL)、UGC外链(UGC)</li>
            <li>导出的文件名会包含类型、项目ID和日期</li>
        </ul>
    </div>
    
    <script>
        // 模拟点击事件
        document.querySelectorAll('.export-btn:not([disabled])').forEach(btn => {
            btn.addEventListener('click', function() {
                if (!this.classList.contains('loading')) {
                    console.log('导出按钮被点击');
                    // 这里会调用实际的导出函数
                }
            });
        });
    </script>
</body>
</html>